/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mx.itschapala.dsw2.controlcobros.vista;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 *
 * @author Maricela
 */
@ManagedBean
@SessionScoped
public class LoginBean {
    //variables locales----------
    private String name;
    private String pass;

    /**
     * Creates a new instance of AccessBean
     */
    //constructor----------------
    public LoginBean() {
    }
    //metodos get y set----------

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPass() {
        return pass;
    }

    public void setPass(String pass) {
        this.pass = pass;
    }
    //Acciones--------------------
    public String validarLogin(){
    if (name.equals("Balcones") && pass.equals("12345") ){
        FacesContext context = FacesContext.getCurrentInstance();
        context.getExternalContext().getSessionMap().put("USUARIO_LOGUEADO", name);
        return "Menu";
    }else{
        
    return "PaginaLogin";
    }
    }
    //Listeners-------------------
}
